Binary signal compression techniques have heretofore been used in order to reduce a memory capacity required for holding image data and to reduce a transmission time of the image data. For example, MH coding has been widely known as a method of compressing binarized image data (heretofore, appropriately referred to as binarized image) with a small-sized hardware. The MH coding method is applied for run-length image compression, being a one-dimensional compression, facsimile or the like.
Japanese Patent Application Laid-Open (JP-A) No. 9-65147, “Image signal compression method, . . . ” discloses a modification of the MH coding. This reference discloses that, at the time of performing the MH coding, white and black run lengths immediately before are stored, and when a run length of a certain color matches with a run length immediately before, a predetermined repetition code is generated. It is possible to improve the compressibility and the processing speed when this technique is applied
JBIG (Joint Bi-level Image experts Group) is widely known as a method of compressing binarized images at high compressibility. JBIG is an international standard of the two-dimensional compression method. Moreover, a QM_coder, being an arithmetic encoder, has been used as the entropy encoder.
Techniques that fall in the same category as the above-mentioned one have been disclosed in “Image data encoding method” of Japanese Patent Application Publication (JP-B) No. 8-34545, “Binarized data compression/expansion circuit, . . . ” of JP-A No. 9-252256, and “Method of and apparatus for data compression, method of and apparatus for data expansion” of Japanese Patent No. 2683506.
However, the prior arts have problems as described below. There is a problem with the technique disclosed in JP-A No. 9-65147, in that it is difficult to obtain a code set having sufficient compressibility, with respect to the image data in which colors change frequently in a short cycle. Moreover, the code set is similar to the MH code, therefore, when a plurality of bits are processed in parallel, a large number of gates are required. As a consequence, a high speed performance cannot be expected.
In the JBIG method, large-sized hardware becomes necessary for a context memory required for the QM_coder and a line memory for preparing the context. As a consequence, it is difficult to achieve high speed.
“Data encoding method/decoding method, . . . ” of JP-A No. 2000-217005 discloses a solution to the above-mentioned problems. This reference disclose a method of encoding in which a numerical progression of a run length based on the data by color obtained by scanning the image is received, converted to a predetermined code queue, and output.
Specifically, what is disclosed in JP-A No. 2000-217005 is as follows. At the time of inputting the numerical value of the run length, if the value matches with the numerical value of the run length immediately before of the same color then it is set as an agreement, and if the values do not match then it is considered as a disagreement. A number of times the agreement occurs is set as a repetition number. Moreover, if the agreement or the disagreement occurs continuously, then a repetition number code corresponding to the repetition number is generated. On the other hand, if the disagreement occurs, then a code corresponding to the value of the run-length numerical value is generated.
With the technique disclosed in JP-A No. 2000-217005, however, a CPU processes as the algorithm of software. Therefore, the processing is performed serially, causing a problem in that it may be difficult to obtain a processing speed required for the image processing of the printer.
On the other hand, parallel processing by means of the hardware can be considered. However, as the number of bits to be processed in parallel increases, combinations for processing the number of bits at a time increases (for example, there exist 16 combinations for 4 bits, 256 combinations for 8 bits, and 2n combinations for n bits), causing an increase of the number of gates of the hardware. Hence, there is a problem in that the number of bits cannot be increased thoughtlessly, in view of the design of the hardware.
Moreover, as other techniques of compressing and expanding the run-length code, there is known an apparatus that compares bit by bit for every clock to count up the run length (see FIG. 10), or an apparatus that increases the processing speed by matching of the same run length (see FIG. 1) in “Binarized image compression apparatus” of JP-A No. 7-236065.
However, with the technique disclosed in FIG. 10 of JP-A No. 7-236065, since one clock is consumed for every BIT, high frequency is required for improving the processing speed. However, in building into LSI, high frequency becomes a problem, and hence speed-up is difficult due to noise, consumed current and generation of heat. There is further a problem in that with an increase of the number of pixels of digital cameras and with an improvement of resolution of scanners, improvement of frequency cannot catch up with an increase of the data to be processed.
On the other hand, with the technique disclosed in FIG. 1 of JP-A No. 7-236065, in case of a long run length, speed-up is possible by the number of bits to be processed in parallel by the pixel detection section and the barrel shifter. However, with respect to a pattern having a short run length of for example, ‘101010’, lots of clocks are consumed, and hence the same problem described with respect to FIG. 1 arises. Moreover, with the techniques disclosed in both the figures, since the processing time is different depending on the pattern, with respect to the image having the same size, there is a problem in that equipments must be designed, assuming a pattern having the worst processing efficiency.